home *** CD-ROM | disk | FTP | other *** search
- Path: frco.com!usenet
- From: Jadam@tcmail.frco.com (Jim Adam)
- Newsgroups: comp.lang.c++
- Subject: Re: dynamic memory allocation
- Date: 1 Feb 1996 18:48:29 GMT
- Organization: Fisher Rosemount Systems
- Message-ID: <4er1tt$jnm@rolaids.frco.com>
- References: <310ABD89.5537@gnomic.stanford.edu> <DM0G35.AKr@news.arco.com>
- NNTP-Posting-Host: primrose.frco.com
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.93.11
-
- In article <DM0G35.AKr@news.arco.com>, lasbfl says...
-
- >Or you can pass a reference to a pointer:
- > void allocfunc( void &*p, size_t n) { p = malloc( n ); }
- ^^^^^
-
- Actually, I think it has to be:
-
- void *& p // "POINTER REFERENCE"
-
- rather than
-
- void &* p // COMPILER ERROR: NOT ALLOWED
-
- It's weird, but the operators appear in opposite order
- of the way you would normally pronounce them. I guess,
- think of it as a pointer reference rather than a reference
- to a pointer? --Just a carry-over from the C declaration
- syntax. (We never noticed this before, because we would
- only have
-
- void ** p
-
- and who cares if the second * was really the first * as
- far as the compiler was concerned???)
-
- Jim
- Jadam@tcmail.frco.com
-
-